Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Fixes SENTRY-FOR-SENTRY-7MET. The issue was that: Missing index on sentry_grouprulestatus.date_added forces full table scan, exceeding database statement timeout.

  • Adds an index to the date_added field in the GroupRuleStatus model.
  • Creates a new migration to alter the date_added field and add the db_index=True property.

This fix was generated by Seer in Sentry, triggered by [email protected]. 👁️ Run ID: 115

Not quite right? Click here to continue debugging with Seer.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Copied from getsentry#101080
Original PR: getsentry#101080

Copy link

Add Database Index to date_added Field on GroupRuleStatus Model

This pull request addresses a database performance issue caused by the lack of an index on the date_added field in the GroupRuleStatus model, which resulted in full table scans and statement timeouts. The solution introduces the db_index=True attribute to the date_added field in src/sentry/models/grouprulestatus.py and adds a corresponding Django migration to apply this schema change in a post-deployment safe manner.

Key Changes

• Modified the date_added field in GroupRuleStatus to add db_index=True.
• Added migration file src/sentry/migrations/0996_add_grouprulestatus_date_added_idx.py to apply the index change in a post-deployment step.

Affected Areas

src/sentry/models/grouprulestatus.py
src/sentry/migrations/0996_add_grouprulestatus_date_added_idx.py

This summary was automatically generated by @propel-code-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant